package com.lanyan.common.enums;

/**
 * 注册状态枚举
 *
 * @author lanyan
 * @date 2024-12-18
 */
public enum RegisterStatusEnum {

    /**
     * 注册不满1天
     */
    REGISTER_LESS_ONE_DAY("1", "注册不满1天"),

    /**
     * 注册满1天不满2天
     */
    REGISTER_ONE_TO_Two_DAYS("2", "注册满1天不满2天"),

    /**
     * 注册满2天不满3天
     */
    REGISTER_TWO_TO_THREE_DAYS("3", "注册满2天不满3天"),

    /**
     * 天消费xx元
     */
    DAY_SPEND_CONSUMMER("4", "前一天消费xx元"),

    /**
     * 所有人
     */
    ALL_USERS("5", "所有人");

    private final String code;
    private final String desc;

    RegisterStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static RegisterStatusEnum fromCode(String code) {
        for (RegisterStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown register status code: " + code);
    }
    }
